# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-pbkdf2_ctypes
pkgname=('python2-pbkdf2_ctypes' 'python-pbkdf2_ctypes')
_pkgname=pbkdf2-ctypes
pkgver=0.99.5
pkgrel=10
pkgdesc='A pbkdf2 implementation for python using ctypes.'
arch=('any')
url='https://pypi.org/project/pbkdf2-ctypes/#files'
license=('GLGPL3')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('2918d5de10c827c0ece8ee4317ff943acedf71db898757852e5ea60ddec0439dea168b09f4c566200b7388ec3b19020c79b08cf96fb6051553d821a1eeb077b5')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-pbkdf2_ctypes() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-pbkdf2_ctypes() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

